package com.example.asdf;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;


public class RowAdapter extends BaseAdapter{

	private Context context;
	private ArrayList<PhoneRowItem> listPhoneRowItem;
	Toast toast;

	public RowAdapter(Context context,
			ArrayList<PhoneRowItem> phoneRowItem) {
		this.context = context;
		this.listPhoneRowItem = phoneRowItem;
		toast = Toast.makeText(context.getApplicationContext(),"", Toast.LENGTH_SHORT);
	}

	@Override
	public int getCount() {
		return listPhoneRowItem.size();
	}

	@Override
	public Object getItem(int position) {
		return listPhoneRowItem.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	 public View getView(final int position, View convertView, ViewGroup parent) {
		
		if (convertView == null) {
			LayoutInflater mInflater = (LayoutInflater)
			context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
			convertView = mInflater.inflate(R.layout.row, null);
		   

		}
		ImageView logo = (ImageView) convertView.findViewById(R.id.logo);
		logo.setImageResource(R.drawable.cubot);
		TextView txt1 = (TextView) convertView.findViewById(R.id.txt1);
		txt1.setText("Alltime ha subido un video");
		ImageView img = (ImageView) convertView.findViewById(R.id.image);
		img.setImageResource(R.drawable.img);
		img.getLayoutParams().width = 10000;

		TextView txt2 = (TextView) convertView.findViewById(R.id.txt2);
		txt2.setText("10 Things You Didn't Know");
		//TextView txtCompare = (TextView) convertView.findViewById(R.id.txtCompare);
		CheckBox ch = (CheckBox) convertView.findViewById(R.id.check);
		TextView txt3 = (TextView) convertView.findViewById(R.id.txt3);
		txt3.setText("About Game of Thrones");
		TextView txt4 = (TextView) convertView.findViewById(R.id.txt4);
		txt4.setText("Alltime 10S 109.876 reproducciones");
        
        PhoneRowItem phone = (PhoneRowItem) getItem(position);	
			
		return convertView;
	 }



}
